package com.blocks.network;

import com.blocks.blocks.Block;
import com.jme3.math.Vector3f;
import com.jme3.network.AbstractMessage;

public class BlockSyncMessage extends AbstractMessage {
	 public long syncId = -1;
	  public double time;
	  public Vector3f location = new Vector3f();
	  public BlockSyncMessage(long id, Block block) {
        this.syncId = id;
        this.location = block.getLocalTranslation();

    }

    public void readData(Block block) {
      this.location = block.getLocalTranslation(); 
    }

    public void applyData(Object block) {
        ((Block) block).setLocalTranslation(location);
    }
}

